<?php
if(!check_manager_login()) exit('无权查看，请登录!');
require_once(MODEL_PATH.DS.'Employ.php');
$Employ = new Employ();
if(check_post()){
	$position = trim($_POST['position']);
	$num = trim($_POST['num']);
	$location = trim($_POST['location']);
	$expire = trim($_POST['expire']);
	$salary = trim($_POST['salary']);
	$description = trim($_POST['description']);
	if(!($position||$location)){
		redirect('index.php?mod=employ&act=add','职位名称或地点不能为空！');
	}
	$data = array(
		'position'=>$position,
		'num'=>$num,
		'location'=>$location,
		'salary'=>$salary,
		'expire'=>$expire,
		'description'=>$description,
		'created'=>date('Y-m-d H:i:s'),
		'updated'=>date('Y-m-d H:i:s'),
	);
	$result = $Employ->addJob($data);
	if($result){
		redirect('index.php?mod=employ&act=list','添加招聘职位成功！');
	}
}

include load_tpl('employ_add');
?>